package top.yudoge.dogeeditorserverj.web.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.yudoge.dogeeditorserverj.common.objects.Response;
import top.yudoge.dogeeditorserverj.service.TextSimilarityService;

@Slf4j
@RestController
@RequestMapping("/test")
public class TestController {
    @Autowired
    private TextSimilarityService textSimilarityService;

    @RequestMapping("/similarity/{text1}/{text2}")
    public Response<Double> similarity(@PathVariable String text1, @PathVariable String text2) {
        double similarity = textSimilarityService.similarity(text1, text2);
        return Response.ok(similarity);
    }
}
